<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    		<form class="form-horizontal" action="/tag/save" method="post">
		    <fieldset>
		    <div class="control-group">
				<input type="hidden" value="${tag.id }" name="id">
		          <label class="control-label" for="input01">名称：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge" name="name" value="${tag.name }">
		            <p class="help-block"></p>
		          </div>
		        </div>
		
		    	<div class="control-group">
		          <label class="control-label" for="input01">显示条数：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge" name="pagesize" value="${tag.pagesize}">
		            <p class="help-block"></p>
		          </div>
		        </div>
		        
		        <div class="control-group">
		          <label class="control-label" for="input01">样式：</label>
		          <div class="controls">
		            <input type="text" placeholder="" class="input-xlarge" name="css" value="${tag.css}">
		            <p class="help-block"></p>
		          </div>
		        </div>
		        
		    
		 	<div class="control-group">
		
		          <div class="controls">
		           
		            <button type="submit" class="btn"">提交</button>
		          </div>
		        </div>
		    </fieldset>
  			</form>
<script type="text/javascript">


 $(document).ready(function() {
  	$("form").validate({
		rules: {
			name: {required:true,maxlength:30},
			pagesize: {required:true,number:true},
			css: {required:true}
		},
		messages: {
				name: {required:"请填写名称",maxlength:"标题不能长于30个字"},
				pagesize: {required:"请填写显示条数",number:"请填写数字"},
				css: {required:"请填写样式"}
			}
		});
  	$('form').ajaxForm({
		beforeSubmit:function(){
			return $('form').validate().form();
		},
		success:function(){
			$('#div_right').load("/tag/manage");
		}
	});
  	
 });
</script>
